from game import *

class Static(pygame.sprite.Sprite):

	def __init__(self, game, image_path, pos = Vector()):
		pygame.sprite.Sprite.__init__(self)
		self.game = game
		self.dbg = False

		# Sprite
		if globals.images.has_key(image_path):
			self.image = globals.images[image_path]
		else:
			self.image = pygame.image.load(os.path.join('data', image_path))
			globals.images[image_path] = self.image
			
		self.image.set_alpha(255, pygame.RLEACCEL)
		self.image = self.image.convert_alpha()
		
		
			
		self.rect = self.image.get_rect()
		self.pos = pos


	def update(self):
		pass

	def draw(self):
		if not self.game.camera.collidepoint(self.pos.to_list()): return

		self.rect.center = self.game.camera.translate(self.pos).to_list()
		
		self.game.screen.blit(self.image, self.rect.topleft)

